﻿@{
    Layout = null;
}
@using WXDba.Entity
@using WXDba.Abstract
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>中秋夜月饼投票统计结果</title>
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" />
    <script src="~/scripts/jquery-1.10.2.min.js"></script>
    <script src="~/scripts/bootstrap.min.js"></script>
    <link href="~/Content/ZhouQiu.css" rel="stylesheet" />
</head>
<body>
    <div class="container">
        <div class="top">
            <img src="~/Content/Images/top.png" />
        </div>

        <div class="center" >
            <p>
                <table class="table table-bordered" style="background:white;">
                    <thead>
                        <tr>
                            <th class="col-xs-3">
                                月饼名称
                            </th>
                            <th>
                                投票数
                            </th>
                        </tr>

                    </thead>
                    <tbody>
                        @{
                            List<string> list = new List<string>() {
                                "五仁月饼",
                                "水果月饼",
                                "豆沙月饼",
                                "冰皮月饼",
                                "双黄莲蓉月饼",
                                "巧克力月饼"
                            };
                            IYueBing _IYueBing = ConcreteFactory.GetYueBing();
                        }

                        @foreach (var item in list)
                        {
                            int like = _IYueBing.GetCount_Like(item, true);
                            int notlike = _IYueBing.GetCount_Like(item, false);
                            int eat = _IYueBing.GetCount_Eat(item, true);
                            int noteat = _IYueBing.GetCount_Eat(item, false);
                            double likePercent = like + notlike;
                            if (likePercent > 0)
                            {
                                likePercent = like * 1.0 / likePercent * 100;

                            }
                            double eatPercent = eat + noteat;
                            if (eatPercent > 0)
                            {
                                eatPercent = eat * 1.0 / eatPercent * 100;
                            }
                            <tr>
                                <td>@item</td>
                                <td>
                                    <h4>喜欢@(like)人，不喜欢@(notlike)人</h4>
                                    <div class="progress">
                                        <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80"
                                             aria-valuemin="0" aria-valuemax="100" style="width: @(likePercent)%">
                                        </div>
                                    </div>
                                    <h4>吃过@(eat)人，没吃过@(noteat)人</h4>
                                    <div class="progress">
                                        <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80"
                                             aria-valuemin="0" aria-valuemax="100" style="width: @(eatPercent)%">
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </p>
            <p></p>
            <div class="row">
                <a href="@Url.Action("ZhongQiu")" class="btn btn-danger btn-lg btn-block" role="button">
                    返回投票
                </a>
                <p></p>
                <p class="text-center">
                   <h4 style="color:white;text-align:center;">亲，右上角分享哦！</h4>
                </p>
            </div>
            <p></p>
            <p></p>
            <p></p>
        </div>
    </div>
    <script src="~/scripts/StorageHelper1.0.js"></script>
    <script src="~/scripts/ZhongQiu.js"></script>
</body>
</html>
